package com.turing.post.salesmanage.util;

import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 赎回单
 * 
 * @author yxb
 * @date 2013-01-22
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "REDEMPORDER")
public class RedempOrder implements java.io.Serializable {

	/**
	 * 0 - 录入
	 */
	public static final String OrderStatus_Input = "0";// 0 - 录入
	/**
	 * 1 - 已确认
	 */
	public static final String OrderStatus_Confirm = "1";// 1 - 已确认，创建完成
//	/**
//	 * 2 - 初审通过
//	 */
//	public static final String OrderStatus_FirPass = "2";// 2 - 初审通过
	/**
	 * 3 - 终审通过
	 */
	public static final String OrderStatus_SecPass = "3";// 3 - 终审通过
	/**
	 * 4 - 已扣帐
	 */
	public static final String OrderStatus_Debit = "4";// 4 - 已扣帐
	/**
	 * 5 - 已付款
	 */
	public static final String OrderStatus_Paid = "5";// 5 - 已付款
	/**
	 * 9 - 取消
	 */
	public static final String OrderStatus_CanRefuse = "9";// 9 - 取消

	public static final String BtnStatus_RedEdit = "RedEdit";// 1 - 已确认
	public static final String BtnStatus_RedBindCard = "RedBindCard";
	// 卡绑定
	public static final String BtnStatus_RedConfirm = "RedConfirm";// 1 - 已确认
	public static final String BtnStatus_RedConfirmCan = "RedConfirmCan";// 已确认过记录
	public static final String BtnStatus_RedFirPass = "RedFirPass";// 2 - 初审
	public static final String BtnStatus_RedFirPassCan = "RedFirPassCan";// 2 -
	// 初审过记录
	public static final String BtnStatus_RedSecPass = "RedSecPass";// 3 - 终审/拒绝
	// or扣减冻结资金
	public static final String BtnStatus_RedSecPassCan = "RedSecPassCan";// 3
	// -扣款不成功
	// 终审过记录
	/**
	 * 4 - 扣帐
	 */
	public static final String BtnStatus_RedDebit = "RedDebit";
	/**
	 * 5 - 付款
	 */
	public static final String BtnStatus_RedPaid = "RedPaid";
	/**
	 * 9 - 取消
	 */
	public static final String BtnStatus_RedCancel = "RedCancel";
	/**
	 * 扣减冻结资金
	 */
	public static final String BtnStatus_DelAccount = "DelAccount";
	/**
	 * 赎回单ID
	 */
	private BigInteger redempOrderId;

	/**
	 * 赎回单单号
	 */
	private String redempOrderSeqNo;

	/**
	 * 发卡商号
	 */
	private String issueCompanyNo;
	/**
	 * 销售机构号
	 */
	private String saleBranchNo;
	/**
	 * 帐务日期
	 */
	private Date tranDate;
	/**
	 * 赎回时间
	 */
	private Date redempTime;

	private BigInteger paidAccountId;// 付款人ID发卡商银行信息必须为发卡商银行账户信息参考:IssueBankAccount
	private BigInteger payeeAccountId;// (FK) 收款人ID 参考:BankAccount
	private String voucherNo;// 凭证号 varchar(60) Null 转账必填
	private String voucherRemark;// 凭证摘要 varchar(60) Null
	private BigInteger voucherImageId;// 凭证图片Id int Null jpg/png等
	private String orderStatus;// 赎回单状态 Char(1) Not Null
	private String accSeqNo;// 赎回帐户子系统记帐流水号 varchar(40) Null 赎回时更改
	private String cancelAccSeqNo;// 撤销赎回帐户子系统记帐流水号 varchar(40) Null 撤销赎回时更改
	private BigInteger personalBuyerId;// (FK) 个人信息ID Int Null
	private BigInteger organizeBuyerId;// (FK) 单位信息ID Int Null
	private BigInteger proxyBuyerId;// (FK) 代理人信息ID Int Null
	private BigInteger operId;// (FK) 操作员ID Int Not Null 参考SysOpUser

	private BigInteger totalRedempAmount;// 总赎回金额
	private BigInteger totalFee;// 总手续费
	private BigInteger totalFactRedempAmount; // 总实际赎回金额

	private String remark;// 备注 varchar(255) Null
	private BigInteger feeAuthOperId;
	private BigInteger totalFactFee;

	private Date cancelDate;
	private Date cancelTime;
	private BigInteger cancelOperId;
	private BigInteger cancelAuthOperId;

	private BigInteger voucherPrintId;

	private String voucherPrintNo;

	/**
	 * 上次赎回记帐帐务日期
	 */
	private Date lastRedempDate;

	/**
	 * 上次撤销赎回记帐帐务日期
	 */
	private Date lastCancelRedempDate;

	/**
	 * 当前查询需要返回的按钮判断、不和数据库对应Transient
	 */
	private String btnStatus;

	public RedempOrder() {

	}

	@Id
	@Column(name = "REDEMPORDERID", unique = true, nullable = false)
	public BigInteger getRedempOrderId() {
		return redempOrderId;
	}

	public void setRedempOrderId(BigInteger redempOrderId) {
		this.redempOrderId = redempOrderId;
	}

	@Column(name = "ISSUECOMPANYNO", nullable = false)
	public String getIssueCompanyNo() {
		return issueCompanyNo;
	}

	public void setIssueCompanyNo(String issueCompanyNo) {
		this.issueCompanyNo = issueCompanyNo;
	}

	@Column(name = "SALEBRANCHNO", nullable = false)
	public String getSaleBranchNo() {
		return saleBranchNo;
	}

	public void setSaleBranchNo(String saleBranchNo) {
		this.saleBranchNo = saleBranchNo;
	}

	@Column(name = "TRANDATE", nullable = false)
	public Date getTranDate() {
		return tranDate;
	}

	public void setTranDate(Date tranDate) {
		this.tranDate = tranDate;
	}

	@Column(name = "REDEMPTIME", nullable = false)
	public Date getRedempTime() {
		return redempTime;
	}

	public void setRedempTime(Date redempTime) {
		this.redempTime = redempTime;
	}

	@Column(name = "PAIDACCOUNTID")
	public BigInteger getPaidAccountId() {
		return paidAccountId;
	}

	public void setPaidAccountId(BigInteger paidAccountId) {
		this.paidAccountId = paidAccountId;
	}

	@Column(name = "PAYEEACCOUNTID")
	public BigInteger getPayeeAccountId() {
		return payeeAccountId;
	}

	public void setPayeeAccountId(BigInteger payeeAccountId) {
		this.payeeAccountId = payeeAccountId;
	}

	@Column(name = "VOUCHERNO")
	public String getVoucherNo() {
		return voucherNo;
	}

	public void setVoucherNo(String voucherNo) {
		this.voucherNo = voucherNo;
	}

	@Column(name = "VOUCHERREMARK")
	public String getVoucherRemark() {
		return voucherRemark;
	}

	public void setVoucherRemark(String voucherRemark) {
		this.voucherRemark = voucherRemark;
	}

	@Column(name = "VOUCHERIMAGEID")
	public BigInteger getVoucherImageId() {
		return voucherImageId;
	}

	public void setVoucherImageId(BigInteger voucherImageId) {
		this.voucherImageId = voucherImageId;
	}

	@Column(name = "ORDERSTATUS")
	public String getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(String orderStatus) {
		this.orderStatus = orderStatus;
	}

	@Column(name = "ACCSEQNO")
	public String getAccSeqNo() {
		return accSeqNo;
	}

	public void setAccSeqNo(String accSeqNo) {
		this.accSeqNo = accSeqNo;
	}

	@Column(name = "CANCELACCSEQNO")
	public String getCancelAccSeqNo() {
		return cancelAccSeqNo;
	}

	public void setCancelAccSeqNo(String cancelAccSeqNo) {
		this.cancelAccSeqNo = cancelAccSeqNo;
	}

	@Column(name = "PERSONALBUYERID")
	public BigInteger getPersonalBuyerId() {
		return personalBuyerId;
	}

	public void setPersonalBuyerId(BigInteger personalBuyerId) {
		this.personalBuyerId = personalBuyerId;
	}

	@Column(name = "ORGANIZEBUYERID")
	public BigInteger getOrganizeBuyerId() {
		return organizeBuyerId;
	}

	public void setOrganizeBuyerId(BigInteger organizeBuyerId) {
		this.organizeBuyerId = organizeBuyerId;
	}

	@Column(name = "PROXYBUYERID")
	public BigInteger getProxyBuyerId() {
		return proxyBuyerId;
	}

	public void setProxyBuyerId(BigInteger proxyBuyerId) {
		this.proxyBuyerId = proxyBuyerId;
	}

	@Column(name = "OPERID")
	public BigInteger getOperId() {
		return operId;
	}

	public void setOperId(BigInteger operId) {
		this.operId = operId;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "redempOrderSeqNo")
	public String getRedempOrderSeqNo() {
		return redempOrderSeqNo;
	}

	public void setRedempOrderSeqNo(String redempOrderSeqNo) {
		this.redempOrderSeqNo = redempOrderSeqNo;
	}

	@Transient
	public String getBtnStatus() {
		return btnStatus;
	}

	public void setBtnStatus(String btnStatus) {
		this.btnStatus = btnStatus;
	}

	@Column(name = "feeAuthOperId")
	public BigInteger getFeeAuthOperId() {
		return feeAuthOperId;
	}

	public void setFeeAuthOperId(BigInteger feeAuthOperId) {
		this.feeAuthOperId = feeAuthOperId;
	}

	@Column(name = "totalFactFee")
	public BigInteger getTotalFactFee() {
		return totalFactFee;
	}

	public void setTotalFactFee(BigInteger totalFactFee) {
		this.totalFactFee = totalFactFee;
	}

	@Column(name = "TOTALREDEMPAMOUNT")
	public BigInteger getTotalRedempAmount() {
		return totalRedempAmount;
	}

	public void setTotalRedempAmount(BigInteger totalRedempAmount) {
		this.totalRedempAmount = totalRedempAmount;
	}

	@Column(name = "TOTALFEE")
	public BigInteger getTotalFee() {
		return totalFee;
	}

	public void setTotalFee(BigInteger totalFee) {
		this.totalFee = totalFee;
	}

	@Column(name = "totalFactRedempAmount")
	public BigInteger getTotalFactRedempAmount() {
		return totalFactRedempAmount;
	}

	public void setTotalFactRedempAmount(BigInteger totalFactRedempAmount) {
		this.totalFactRedempAmount = totalFactRedempAmount;
	}

	@Column(name = "cancelDate")
	public Date getCancelDate() {
		return cancelDate;
	}

	public void setCancelDate(Date cancelDate) {
		this.cancelDate = cancelDate;
	}

	@Column(name = "cancelTime")
	public Date getCancelTime() {
		return cancelTime;
	}

	public void setCancelTime(Date cancelTime) {
		this.cancelTime = cancelTime;
	}

	@Column(name = "cancelOperId")
	public BigInteger getCancelOperId() {
		return cancelOperId;
	}

	public void setCancelOperId(BigInteger cancelOperId) {
		this.cancelOperId = cancelOperId;
	}

	@Column(name = "cancelAuthOperId")
	public BigInteger getCancelAuthOperId() {
		return cancelAuthOperId;
	}

	public void setCancelAuthOperId(BigInteger cancelAuthOperId) {
		this.cancelAuthOperId = cancelAuthOperId;
	}

	@Column(name = "voucherPrintId")
	public BigInteger getVoucherPrintId() {
		return voucherPrintId;
	}

	public void setVoucherPrintId(BigInteger voucherPrintId) {
		this.voucherPrintId = voucherPrintId;
	}

	@Column(name = "voucherPrintNo")
	public String getVoucherPrintNo() {
		return voucherPrintNo;
	}

	public void setVoucherPrintNo(String voucherPrintNo) {
		this.voucherPrintNo = voucherPrintNo;
	}

	public void setLastRedempDate(Date lastRedempDate) {
		this.lastRedempDate = lastRedempDate;
	}

	public Date getLastRedempDate() {
		return lastRedempDate;
	}

	public void setLastCancelRedempDate(Date lastCancelRedempDate) {
		this.lastCancelRedempDate = lastCancelRedempDate;
	}

	public Date getLastCancelRedempDate() {
		return lastCancelRedempDate;
	}
}